package com.guohengspace.mq.controller;

import com.guohengspace.mq.common.ResponseResult;
import com.guohengspace.mq.service.OrganizationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/organization")
@Slf4j
public class OrganizationController {

    @Autowired
    private OrganizationService organizationService;


    @GetMapping("/list")
    ResponseResult getOrganizationList() {
        ResponseResult responseResult = organizationService.getOrganizationList();
        return responseResult;
    }

    @GetMapping("/listResourceGroupByOrgId")
    ResponseResult listResourceGroupByOrgId(@RequestParam("organizationId") String organizationId) {
        ResponseResult responseResult = organizationService.listResourceGroupByOrgId(organizationId);
        return responseResult;
    }

}
